<div class="layui-side layui-bg-black">
	<div class="layui-side-scroll">
		<#include "/apps/business/xiaoe/include/left.html">
	</div>
</div>
<div class="layui-body">
	<div class="layui-side-scroll">
			<form method="post" key="set-mine" enctype="multipart/form-data" action="/apps/xiaoe/config/save.html" class="layui-form">
				<input type="hidden" name="aiid" value="${aiConfig.aiid!''}">
				<#if aiConfig??><input type="hidden" name="id" value="${aiConfig.id!''}"></#if>
				<div class="row">
					<div class="col-lg-12">
						<div class="ukefu-customer-div setting-wrapper">
							<div class="box default-box">
								<div class="box-header">
									<h3 class="box-title">机器人${serviceAi.name!''}（${serviceAi.id!''}）对话设置</h3>
								</div>
								<div class="box-body ukefu-im-theme">
									<div class="row">
										<div class="col-lg-8">
											<div class="ukefu-webim-prop">
												<div class="ukefu-webim-tl" style="clear:both;"><span class="inx">1</span>、机器人接入欢迎提示语</div>
												<div class="box-item">
													<div class="row">
														<div class="col-lg-12">
															<p style="margin-bottom:10px;">机器人接入的欢迎语，适用于WebIM渠道，微信渠道</p>
														</div>
													</div>
													<div class="row"  style="margin-bottom:20px;">
														<div class="col-lg-12">
															<textarea name="welcomemsg" id="welcomemsg" autocomplete="off" class="layui-input" resize="false" style="height:90px;line-height:22px;resize: none;"><#if aiConfig?? && aiConfig.welcomemsg??>${aiConfig.welcomemsg}<#else>欢迎您使用智能机器人咨询！</#if></textarea>
														</div>
													</div>
												</div>
											</div>
											<div class="ukefu-webim-prop">
												<div class="ukefu-webim-tl" style="clear:both;"><span class="inx">2</span>、接入外部机器人</div>
												<div class="box-item">
													<div class="row">
														<div class="col-lg-8">
															<p>启用此功能后，机器人服务请求将被转发到外部机器人接口</p>
															<p style="color:#888888;font-size:13px;margin-top:10px;">外部机器人通过HTTP请求访问，支持GET、POST方法</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="checkbox" id="enableother" name="enableother" lay-filter="enableother" title="启用" <#if aiConfig?? && aiConfig.enableother == true>checked="checked"</#if>>
														</div>
													</div>
												</div>
												<div class="box-item" id="other_ai" style="<#if aiConfig?? && aiConfig.enableother == false>display:none;</#if>">	
													<div class="row" style="margin-bottom:20px;">
														<div class="col-lg-8">
															<p>a、外部机器人访问URL</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="text" name="otherurl" id="otherurl" maxlength="255" value="<#if aiConfig?? && aiConfig.otherurl??>${aiConfig.otherurl}</#if>" autocomplete="off" class="layui-input">
														</div>
													</div>
													<div class="row"  style="margin-bottom:20px;">
														<div class="col-lg-8">
															<p>b、外部机器人启用HTTPS访问</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="checkbox" id="otherssl" name="otherssl" title="启用" <#if aiConfig?? && aiConfig.otherssl == true>checked="checked"</#if>>
														</div>
													</div>
													<div class="row"  style="margin-bottom:20px;">
														<div class="col-lg-8">
															<p>c、外部机器人需要登录</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="checkbox" id="otherlogin" name="otherlogin" title="启用" <#if aiConfig?? && aiConfig.otherlogin == true>checked="checked"</#if>>
														</div>
													</div>
													<div class="row"  style="margin-bottom:20px;">
														<div class="col-lg-8">
															<p>d、外部机器人访问方式</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<select name="othermethod">
																<option value="get" <#if aiConfig.othermethod?? && aiConfig.othermethod == "get">selected="selected"</#if>>GET</option>
																<option value="post" <#if aiConfig.othermethod?? && aiConfig.othermethod == "post">selected="selected"</#if>>POST</option>
															</select>
														</div>
													</div>
													<div class="row"  style="margin-bottom:20px;">
														<div class="col-lg-8">
															<p>e、外部机器人输入参数模板</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<select name="othertempletinput">
																<option value="">请选择输入参数格式化模板</option>
																<#if innputtemlet??>
																<#list innputtemlet as it>
																<option value="${it.id!''}" <#if aiConfig?? && aiConfig.othertempletinput?? && aiConfig.othertempletinput == it.id>selected="selected"</#if>>${it.name!''}</option>
																</#list>
																</#if>
															</select>
														</div>
													</div>
													<div class="row"  style="margin-bottom:20px;">
														<div class="col-lg-8">
															<p>f、外部机器人返回结果格式化模板</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<select name="othertempletoutput">
																<option value="">请选择输出格式化模板</option>
																<#if outputtemlet??>
																<#list outputtemlet as ot>
																<option value="${ot.id!''}" <#if aiConfig?? && aiConfig.othertempletoutput?? && aiConfig.othertempletoutput == ot.id>selected="selected"</#if>>${ot.name!''}</option>
																</#list>
																</#if>
															</select>
														</div>
													</div>
													
													<div class="row" style="margin-top:10px;">
														<div class="col-lg-8">
															<p>g、外部机器人问题详情接口地址</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="text" name="oqrdetailurl" id="oqrdetailurl" value="<#if aiConfig??>${aiConfig.oqrdetailurl!''}</#if>" autocomplete="off" class="layui-input" style="display:inline;">
														</div>
													</div>
													<div class="row" style="margin-top:10px;">
														<div class="col-lg-8">
															<p>h、外部机器人问题详情输入参数</p>
														</div>
														<div class="col-lg-4">
															<select name="oqrdetailinput">
																<option value="">请选择详情接口输入参数格式化模板</option>
																<#if innputtemlet??>
																<#list innputtemlet as it>
																<option value="${it.id!''}" <#if aiConfig?? && aiConfig.oqrdetailinput?? && aiConfig.oqrdetailinput == it.id>selected="selected"</#if>>${it.name!''}</option>
																</#list>
																</#if>
															</select>
														</div>
													</div>
													<div class="row" style="margin-top:10px;">
														<div class="col-lg-8">
															<p>i、外部机器人问题详情输出参数</p>
														</div>
														<div class="col-lg-4">
															<select name="oqrdetailoutput">
																<option value="">请选择详情接口输出参数格式化模板</option>
																<#if outputtemlet??>
																<#list outputtemlet as it>
																<option value="${it.id!''}" <#if aiConfig?? && aiConfig.oqrdetailoutput?? && aiConfig.oqrdetailoutput == it.id>selected="selected"</#if>>${it.name!''}</option>
																</#list>
																</#if>
															</select>
														</div>
													</div>
													<div class="row"  style="margin-top:10px;">
														<div class="col-lg-8">
															<p>j、机器人未取得结果或错误转人工</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="checkbox" id="transagent" name="transagent" title="启用" <#if aiConfig?? && aiConfig.transagent == true>checked="checked"</#if>>
														</div>
													</div>
												</div>
											</div>
											<div class="ukefu-webim-prop ukefu-ai" style="<#if aiConfig?? && aiConfig.enableother == true>display:none;</#if>">
												<div class="ukefu-webim-tl" style="clear:both;"><span class="inx">3</span>、启用问答知识库匹配</div>
												<div class="box-item">
													<div class="row">
														<div class="col-lg-8">
															<p>启用此功能后，使用“知识维护”中的内容响应用户请求</p>
															<p style="color:#888888;font-size:13px;margin-top:10px;">默认按照关键词匹配算法，系统会解析用户提问的内容，提取其中的关键词</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="checkbox" id="enableask" name="enableask" title="启用" <#if aiConfig?? && aiConfig.enableask == true>checked="checked"</#if>>
														</div>
													</div>
												</div>
											</div>
											<div class="ukefu-webim-prop ukefu-ai" style="<#if aiConfig?? && aiConfig.enableother == true>display:none;</#if>">
												<div class="ukefu-webim-tl" style="clear:both;"><span class="inx">4</span>、问答知识库优先匹配</div>
												<div class="box-item">
													<div class="row">
														<div class="col-lg-8">
															<p>启用此功能后，优先使用“知识维护”中的内容响应用户请求</p>
															<p style="color:#888888;font-size:13px;margin-top:10px;">优先策略选择，默认即为 问答知识库 优先匹配</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="checkbox" id="askfirst" name="askfirst" title="启用" <#if aiConfig?? && aiConfig.askfirst == true>checked="checked"</#if>>
														</div>
													</div>
												</div>
											</div>
											
											<div class="ukefu-webim-prop ukefu-ai" style="<#if aiConfig?? && aiConfig.enableother == true>display:none;</#if>">
												<div class="ukefu-webim-tl" style="clear:both;"><span class="inx">5</span>、启用对话场景识别</div>
												<div class="box-item">
													<div class="row">
														<div class="col-lg-8">
															<p>启用此功能后，系统将会识别当前用户的对话场景</p>
															<p style="color:#888888;font-size:13px;margin-top:10px;">前置识别失败的情况下启用，或场景识别优先的情况下启用</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="checkbox" id="enablescene" name="enablescene" title="启用" <#if aiConfig?? && aiConfig.enablescene == true>checked="checked"</#if>>
														</div>
													</div>
												</div>
											</div>
											
											<div class="ukefu-webim-prop ukefu-ai" style="<#if aiConfig?? && aiConfig.enableother == true>display:none;</#if>">
												<div class="ukefu-webim-tl" style="clear:both;"><span class="inx">6</span>、优先启用对话场景识别</div>
												<div class="box-item">
													<div class="row">
														<div class="col-lg-8">
															<p>启用此功能后，优先使用场景识别功能响应用户请求</p>
															<p style="color:#888888;font-size:13px;margin-top:10px;">优先场景识别，识别失败后，启用后续匹配功能</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="checkbox" id="scenefirst" name="scenefirst" title="启用" <#if aiConfig?? && aiConfig.scenefirst == true>checked="checked"</#if>>
														</div>
													</div>
												</div>
											</div>
											
											<div class="ukefu-webim-prop ukefu-ai" style="<#if aiConfig?? && aiConfig.enableother == true>display:none;</#if>">
												<div class="ukefu-webim-tl" style="clear:both;"><span class="inx">7</span>、启用关键词、关键短语识别</div>
												<div class="box-item">
													<div class="row">
														<div class="col-lg-8">
															<p>启用此功能后，优先使用场景识别功能响应用户请求</p>
															<p style="color:#888888;font-size:13px;margin-top:10px;">优先场景识别，识别失败后，启用后续匹配功能</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="checkbox" id="enablekeyword" name="enablekeyword" lay-filter="enk_filter" title="启用" <#if aiConfig?? && aiConfig.enablekeyword == true>checked="checked"</#if>>
														</div>
													</div>
													<div id="enk" style="<#if aiConfig.enablekeyword == false>display:none;</#if>">
														<div class="row" style="margin-top:20px;">
															<div class="col-lg-8">
																<p>自动识别关键词权重</p>
																<p style="color:#888888;font-size:13px;margin-top:10px;">自动识别关键词默认权重分值是20，可以通过调节数值来影响排序</p>
															</div>
															<div class="col-lg-4" style="text-align:right;">
																<select name="keywordscore">
																	<option value="1" <#if aiConfig.keywordscore == 1>selected="selected"</#if>>1</option>
																	<option value="2" <#if aiConfig.keywordscore == 2>selected="selected"</#if>>2</option>
																	<option value="3" <#if aiConfig.keywordscore == 3>selected="selected"</#if>>3</option>
																	<option value="4" <#if aiConfig.keywordscore == 4>selected="selected"</#if>>4</option>
																	<option value="5" <#if aiConfig.keywordscore == 5>selected="selected"</#if>>5</option>
																	<option value="10" <#if aiConfig.keywordscore == 10>selected="selected"</#if>>10</option>
																	<option value="20" <#if aiConfig.keywordscore == 20>selected="selected"</#if>>20</option>
																	<option value="30" <#if aiConfig.keywordscore == 30>selected="selected"</#if>>30</option>
																	<option value="40" <#if aiConfig.keywordscore == 40>selected="selected"</#if>>40</option>
																	<option value="50" <#if aiConfig.keywordscore == 50>selected="selected"</#if>>50</option>
																	<option value="100" <#if aiConfig.keywordscore == 100>selected="selected"</#if>>100</option>
																	
																</select>
															</div>
														</div>
														<div class="row" style="margin-top:20px;">
															<div class="col-lg-8">
																<p>自定义关键词权重</p>
																<p style="color:#888888;font-size:13px;margin-top:10px;">自定义关键词默认权重分值是20，可以通过调节数值来影响排序</p>
															</div>
															<div class="col-lg-4" style="text-align:right;">
																<select name="userdefinescore">
																	<option value="1" <#if aiConfig.userdefinescore == 1>selected="selected"</#if>>1</option>
																	<option value="2" <#if aiConfig.userdefinescore == 2>selected="selected"</#if>>2</option>
																	<option value="3" <#if aiConfig.userdefinescore == 3>selected="selected"</#if>>3</option>
																	<option value="4" <#if aiConfig.userdefinescore == 4>selected="selected"</#if>>4</option>
																	<option value="5" <#if aiConfig.userdefinescore == 5>selected="selected"</#if>>5</option>
																	<option value="10" <#if aiConfig.userdefinescore == 10>selected="selected"</#if>>10</option>
																	<option value="20" <#if aiConfig.userdefinescore == 20>selected="selected"</#if>>20</option>
																	<option value="30" <#if aiConfig.userdefinescore == 30>selected="selected"</#if>>30</option>
																	<option value="40" <#if aiConfig.userdefinescore == 40>selected="selected"</#if>>40</option>
																	<option value="50" <#if aiConfig.userdefinescore == 50>selected="selected"</#if>>50</option>
																	<option value="100" <#if aiConfig.userdefinescore == 100>selected="selected"</#if>>100</option>
																	
																</select>
															</div>
														</div>
														<div class="row" style="margin-top:20px;">
															<div class="col-lg-8">
																<p>主题关键词权重</p>
																<p style="color:#888888;font-size:13px;margin-top:10px;">主题关键词默认权重分值是10，可以通过调节数值来影响排序</p>
															</div>
															<div class="col-lg-4" style="text-align:right;">
																<select name="topicscore">
																	<option value="1" <#if aiConfig.topicscore == 1>selected="selected"</#if>>1</option>
																	<option value="2" <#if aiConfig.topicscore == 2>selected="selected"</#if>>2</option>
																	<option value="3" <#if aiConfig.topicscore == 3>selected="selected"</#if>>3</option>
																	<option value="4" <#if aiConfig.topicscore == 4>selected="selected"</#if>>4</option>
																	<option value="5" <#if aiConfig.topicscore == 5>selected="selected"</#if>>5</option>
																	<option value="10" <#if aiConfig.topicscore == 10>selected="selected"</#if>>10</option>
																	<option value="20" <#if aiConfig.topicscore == 20>selected="selected"</#if>>20</option>
																	<option value="30" <#if aiConfig.topicscore == 30>selected="selected"</#if>>30</option>
																	<option value="40" <#if aiConfig.topicscore == 40>selected="selected"</#if>>40</option>
																	<option value="50" <#if aiConfig.topicscore == 50>selected="selected"</#if>>50</option>
																	<option value="100" <#if aiConfig.topicscore == 100>selected="selected"</#if>>100</option>
																	
																</select>
															</div>
														</div>
														<div class="row" style="margin-top:20px;">
															<div class="col-lg-8">
																<p>标题权重</p>
																<p style="color:#888888;font-size:13px;margin-top:10px;">命中知识库内容的时候，标题检索权重</p>
															</div>
															<div class="col-lg-4" style="text-align:right;">
																<select name="titlescore">
																	<option value="1" <#if aiConfig.titlescore == 1>selected="selected"</#if>>1</option>
																	<option value="2" <#if aiConfig.titlescore == 2>selected="selected"</#if>>2</option>
																	<option value="3" <#if aiConfig.titlescore == 3>selected="selected"</#if>>3</option>
																	<option value="4" <#if aiConfig.titlescore == 4>selected="selected"</#if>>4</option>
																	<option value="5" <#if aiConfig.titlescore == 5>selected="selected"</#if>>5</option>
																	<option value="10" <#if aiConfig.titlescore == 10>selected="selected"</#if>>10</option>
																	
																</select>
															</div>
														</div>
														
														<div class="row" style="margin-top:20px;">
															<div class="col-lg-8">
																<p>类似问题权重</p>
																<p style="color:#888888;font-size:13px;margin-top:10px;">命中知识库内容的时候，更多类似问题检索权重</p>
															</div>
															<div class="col-lg-4" style="text-align:right;">
																<select name="silimarscore">
																	<option value="1" <#if aiConfig.silimarscore == 1>selected="selected"</#if>>1</option>
																	<option value="2" <#if aiConfig.silimarscore == 2>selected="selected"</#if>>2</option>
																	<option value="3" <#if aiConfig.silimarscore == 3>selected="selected"</#if>>3</option>
																	<option value="4" <#if aiConfig.silimarscore == 4>selected="selected"</#if>>4</option>
																	<option value="5" <#if aiConfig.silimarscore == 5>selected="selected"</#if>>5</option>
																	<option value="10" <#if aiConfig.silimarscore == 10>selected="selected"</#if>>10</option>
																	
																</select>
															</div>
														</div>
														<div class="box-item" id="re_timeout_tip">	
															<div class="row">
																<div class="col-lg-8">
																	<p>最多识别的关键词、短语数量</p>
																</div>
																<div class="col-lg-4">
																	<select name="keywordnum">
																		<option value="0" <#if aiConfig?? && aiConfig.keywordnum?? && aiConfig.keywordnum == 0>selected="selected"</#if>>0</option>
																		<option value="1" <#if aiConfig?? && aiConfig.keywordnum?? && aiConfig.keywordnum == 1>selected="selected"</#if>>1</option>
																		<option value="2" <#if aiConfig?? && aiConfig.keywordnum?? && aiConfig.keywordnum == 2>selected="selected"</#if>>2</option>
																		<option value="3" <#if aiConfig?? && aiConfig.keywordnum?? && aiConfig.keywordnum == 3>selected="selected"</#if>>3</option>
																		<option value="4" <#if aiConfig?? && aiConfig.keywordnum?? && aiConfig.keywordnum == 4>selected="selected"</#if>>4</option>
																	  	<option value="5" <#if !aiConfig?? || aiConfig.keywordnum == 5>selected="selected"</#if>>5</option>
																	  	<option value="6" <#if aiConfig?? && aiConfig.keywordnum?? && aiConfig.keywordnum == 6>selected="selected"</#if>>6</option>
																	  	<option value="7" <#if aiConfig?? && aiConfig.keywordnum?? && aiConfig.keywordnum == 7>selected="selected"</#if>>7</option>
																	  	<option value="8" <#if aiConfig?? && aiConfig.keywordnum?? && aiConfig.keywordnum == 8>selected="selected"</#if>>8</option>
																	  	<option value="9" <#if aiConfig?? && aiConfig.keywordnum?? && aiConfig.keywordnum == 9>selected="selected"</#if>>9</option>
																	  	<option value="10" <#if aiConfig?? && aiConfig.keywordnum?? && aiConfig.keywordnum == 10>selected="selected"</#if>>10</option>
																	  	<option value="15" <#if aiConfig?? && aiConfig.keywordnum?? && aiConfig.keywordnum == 15>selected="selected"</#if>>15</option>
																	  	<option value="20" <#if aiConfig?? && aiConfig.keywordnum?? && aiConfig.keywordnum == 20>selected="selected"</#if>>20</option>
																	</select>
																</div>
															</div>
														</div>
														<div class="box-item">
															<div class="row">
																<div class="col-lg-8">
																	<p>启用关键词实体识别</p>
																	<p style="color:#888888;font-size:13px;margin-top:10px;">实体识别是包含了人名、地名、机构名称等一系列名词自动识别</p>
																</div>
																<div class="col-lg-4" style="text-align:right;">
																	<input type="checkbox" title="启用" name="entity" id="entity" lay-filter="entityop" <#if aiConfig?? && aiConfig.entity == true>checked="checked"</#if>>
																</div>
															</div>
														</div>
														<div class="box-item" id="entityop_tip" style="<#if !(aiConfig??) || aiConfig.entity == false>display:none;</#if>">	
															<div class="row"  style="margin-bottom:20px;">
																<div class="col-lg-8">
																	<p>a、自动识别以下实体类型</p>
																</div>
															</div>
															<div class="row"  style="margin-bottom:20px;">
																<div class="col-lg-12">
																	<#if entityTypeList??>
																	<#list entityTypeList as op>
																	<input type="checkbox" name="entitytp" title="${op.name!''}" value="${op.code!''}" lay-skin="primary" <#if aiConfig.entitytp?? && aiConfig.entitytp?index_of(op.code) gte 0>checked="checked"</#if>>
																	</#list>
																	</#if>
																</div>
															</div>
															
															<div class="row">
																<div class="col-lg-8">
																	<p>实体识别权重</p>
																</div>
																<div class="col-lg-4">
																	<select name="entityscore">
																		<option value="1" <#if aiConfig.entityscore == 1>selected="selected"</#if>>1</option>
																		<option value="2" <#if aiConfig.entityscore == 2>selected="selected"</#if>>2</option>
																		<option value="3" <#if aiConfig.entityscore == 3>selected="selected"</#if>>3</option>
																		<option value="4" <#if aiConfig.entityscore == 4>selected="selected"</#if>>4</option>
																		<option value="5" <#if aiConfig.entityscore == 5>selected="selected"</#if>>5</option>
																		<option value="10" <#if aiConfig.entityscore == 10>selected="selected"</#if>>10</option>
																		<option value="20" <#if aiConfig.entityscore == 20>selected="selected"</#if>>20</option>
																		<option value="30" <#if aiConfig.entityscore == 30>selected="selected"</#if>>30</option>
																		<option value="40" <#if aiConfig.entityscore == 40>selected="selected"</#if>>40</option>
																		<option value="50" <#if aiConfig.entityscore == 50>selected="selected"</#if>>50</option>
																		<option value="100" <#if aiConfig.entityscore == 100>selected="selected"</#if>>100</option>
																	</select>
																</div>
															</div>
														</div>
													</div>
												</div>
											</div>
											<div class="ukefu-webim-prop">
												<div class="ukefu-webim-tl" style="clear:both;"><span class="inx"><#if aiConfig?? && aiConfig.enableother == true>3<#else>8</#if></span>、智能机器人未命中结果后回复内容</div>
												<div class="box-item">
													<div class="row">
														<div class="col-lg-12">
															<textarea name="noresultmsg" id="noresultmsg" autocomplete="off" class="layui-input" resize="false" style="height:90px;line-height:22px;resize: none;"><#if aiConfig?? && aiConfig.noresultmsg??>${aiConfig.noresultmsg}</#if></textarea>
														</div>
													</div>
												</div>
											</div>
											
											<div class="ukefu-webim-prop">
												<div class="ukefu-webim-tl" style="clear:both;"><span class="inx"><#if aiConfig?? && aiConfig.enableother == true>4<#else>9</#if></span>、启用问题推荐功能</div>
												<div class="box-item">
													<div class="row">
														<div class="col-lg-8">
															<p>启用此功能后，如果知识库配置了关联问题，将会将关键问题推荐给访客</p>
															<p style="color:#888888;font-size:13px;margin-top:10px;">如果启用了第三方接口，则可以使用此功能显示推荐的问题</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="checkbox" id="enablesuggest" name="enablesuggest" lay-filter="enablesuggest" title="启用" <#if aiConfig?? && aiConfig.enablesuggest == true>checked="checked"</#if>>
														</div>
													</div>
												</div>
												<div class="box-item" id="enablesuggest_item" style="<#if aiConfig?? && aiConfig.enablesuggest == false>display:none;</#if>">	
													<div class="ukefu-webim-tl" style="clear:both;">a、智能机器人未命中结果后的推荐内容</div>
													<div class="row"  style="margin-bottom:20px;">
														<div class="col-lg-12">
															<textarea name="suggestmsg" id="suggestmsg" autocomplete="off" class="layui-input" resize="false" style="height:70px;line-height:22px;resize: none;" maxlength="255"><#if aiConfig?? && aiConfig.suggestmsg??>${aiConfig.suggestmsg}<#else>未找到合适的答案，建议您尝试换个问法，例如</#if></textarea>
														</div>
													</div>
												</div>
												<div class="box-item" id="enablesuggest_item" style="<#if aiConfig?? && aiConfig.enablesuggest == false>display:none;</#if>">	
													<div class="ukefu-webim-tl" style="clear:both;">b、智能机器人命中结果后的推荐内容</div>
													<div class="row"  style="margin-bottom:20px;">
														<div class="col-lg-12">
															<textarea name="othersuggestmsg" id="othersuggestmsg" autocomplete="off" class="layui-input" resize="false" style="height:70px;line-height:22px;resize: none;" maxlength="255"><#if aiConfig?? && aiConfig.othersuggestmsg??>${aiConfig.othersuggestmsg}<#else>我们还找到下面这些您可能关心的内容：</#if></textarea>
														</div>
													</div>
												</div>
											</div>
											
											<div class="ukefu-webim-prop">
												<div class="ukefu-webim-tl" style="clear:both;"><span class="inx"><#if aiConfig?? && aiConfig.enableother == true>5<#else>10</#if></span>、启用机器人回答评价功能</div>
												<div class="box-item">
													<div class="row">
														<div class="col-lg-8">
															<p>启用此功能后，在问答的时候，提示访客选择问答答案是否解决了问题</p>
															<p style="color:#888888;font-size:13px;margin-top:10px;">需要设置“已解决”和“未解决”选项</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="checkbox" id="topicuseful" name="topicuseful" lay-filter="topicuseful" title="启用" <#if aiConfig?? && aiConfig.topicuseful == true>checked="checked"</#if>>
														</div>
													</div>
												</div>
												<div class="box-item" id="topicuseful_tip" style="<#if aiConfig?? && aiConfig.topicuseful == false>display:none;</#if>">	
													<div class="row" style="margin-bottom:20px;">
														<div class="col-lg-8">
															<p>a、问题答案评价提示消息</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="text" name="topicusefulmsg" id="topicusefulmsg" value="<#if aiConfig?? && aiConfig.topicusefulmsg?? && aiConfig.topicusefulmsg != ''>${aiConfig.topicusefulmsg}<#else>此条知识是否解决了您的问题？</#if>" autocomplete="off" class="layui-input">
														</div>
													</div>
													<div class="row" style="margin-bottom:20px;">
														<div class="col-lg-8">
															<p>b、显示已解决按钮文字</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="text" name="topicusefulok" id="topicusefulok" value="<#if aiConfig?? && aiConfig.topicusefulok?? && aiConfig.topicusefulok!= ''>${aiConfig.topicusefulok}<#else>已解决</#if>" autocomplete="off" class="layui-input" style="width:80px;display:inline;">
														</div>
													</div>
													<div class="row" style="margin-bottom:20px;">
														<div class="col-lg-8">
															<p>c、显示未解决按钮文字</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="text" name="topicusefulno" id="topicusefulno" value="<#if aiConfig?? && aiConfig.topicusefulno?? && aiConfig.topicusefulno!= ''>${aiConfig.topicusefulno}<#else>未解决</#if>" autocomplete="off" class="layui-input" style="width:80px;display:inline;">
														</div>
													</div>
													<div class="row"  style="margin-bottom:20px;">
														<div class="col-lg-8">
															<p>d、评价感谢提示语</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="text" name="topicusefultip" id="topicusefultip"  maxlength="255" value="<#if aiConfig?? && aiConfig.topicusefultip?? && aiConfig.topicusefultip != ''>${aiConfig.topicusefultip}<#else>感谢您的参与！</#if>" autocomplete="off" class="layui-input">
														</div>
													</div>
													<!-- 
													<div class="row"  style="margin-bottom:20px;">
														<div class="col-lg-8">
															<p>e、未解决提示原因选项</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="checkbox" id="topicusefulask" name="topicusefulask" title="启用" <#if aiConfig?? && aiConfig.topicusefulask == true>checked="checked"</#if>>
														</div>
													</div>
													 -->
													<div class="row"  style="margin-bottom:20px;">
														<div class="col-lg-8">
															<p>e、点击“未解决”后启用快速转人工坐席功能</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="checkbox" id="quickagent" name="quickagent" title="启用" <#if aiConfig?? && aiConfig.quickagent == true>checked="checked"</#if>>
														</div>
													</div>
													
													<div class="row"  style="margin-bottom:20px;">
														<div class="col-lg-8">
															<p>f、快速转人工坐席链接提示语</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="text" name="quickagentmsg" id="quickagentmsg"  maxlength="255" value="<#if aiConfig?? && aiConfig.quickagentmsg?? && aiConfig.quickagentmsg!= ''>${aiConfig.quickagentmsg}<#else>立即转人工坐席</#if>" autocomplete="off" class="layui-input">
														</div>
													</div>
													
													<div class="row"  style="margin-bottom:20px;">
														<div class="col-lg-8">
															<p>g、无坐席在线提示语</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="text" name="noagentmsg" id="noagentmsg"  maxlength="255" value="<#if aiConfig?? && aiConfig.noagentmsg?? && aiConfig.noagentmsg!= ''>${aiConfig.noagentmsg}<#else>无坐席在线</#if>" autocomplete="off" class="layui-input">
														</div>
													</div>
												</div>
											</div>
											
											
											<div class="ukefu-webim-prop">
												<div class="ukefu-webim-tl" style="clear:both;"><span class="inx"><#if aiConfig?? && aiConfig.enableother == true>6<#else>11</#if></span>、机器人未命中时显示转人工按钮</div>
												<div class="box-item">
													<div class="row">
														<div class="col-lg-8">
															<p>启用此功能后，在问答的时候，如果机器人未命中结果，显示转人工</p>
															<p style="color:#888888;font-size:13px;margin-top:10px;">需要设置转人工提示消息</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="checkbox" id="sysmsgtransagent" name="sysmsgtransagent" lay-filter="sysmsgtransagent" title="启用" <#if aiConfig?? && aiConfig.sysmsgtransagent == true>checked="checked"</#if>>
														</div>
													</div>
												</div>
												<div class="box-item" id="sysmsgtransagent_tip" style="<#if aiConfig?? && aiConfig.sysmsgtransagent == false>display:none;</#if>">	
													<div class="row" style="margin-bottom:20px;">
														<div class="col-lg-8">
															<p>a、转人工提示消息</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="text" name="sysmsgtransagentmsg" id="sysmsgtransagentmsg" value="<#if aiConfig?? && aiConfig.sysmsgtransagentmsg??>${aiConfig.sysmsgtransagentmsg}</#if>" autocomplete="off" class="layui-input">
														</div>
													</div>
												</div>
											</div>
											
											
											<div class="ukefu-webim-prop">
												<div class="ukefu-webim-tl" style="clear:both;"><span class="inx"><#if aiConfig?? && aiConfig.enablesmartsuggest == true>7<#else>12</#if></span>、启用外部智能推荐</div>
												<div class="box-item">
													<div class="row">
														<div class="col-lg-8">
															<p>启用外部智能推荐功能，通过接口访问</p>
															<p style="color:#888888;font-size:13px;margin-top:10px;">外部智能推荐的输入和输出参数</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="checkbox" title="启用" name="enablesmartsuggest" id="enablesmartsuggest" lay-filter="smartsuggestsuggest" <#if aiConfig?? && aiConfig.enablesmartsuggest == true>checked="checked"</#if>>
														</div>
													</div>
												</div>
												<div class="box-item" id="smartsuggestsuggest_op" style="<#if aiConfig?? && aiConfig.enablesmartsuggest == false>display:none;</#if>">	
													<div class="row"  style="margin-bottom:20px;">
														<div class="col-lg-8">
															<p>a、外部智能推荐启用HTTPS访问</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="checkbox" id="smartsuggestssl" name="smartsuggestssl" title="启用" <#if aiConfig?? && aiConfig.smartsuggestssl == true>checked="checked"</#if>>
														</div>
													</div>
													<div class="row">
														<div class="col-lg-8">
															<p>b、外部智能推荐的接口地址</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="text" name="smartsuggesturl" id="smartsuggesturl" value="<#if aiConfig??>${aiConfig.smartsuggesturl!''}</#if>" autocomplete="off" class="layui-input" style="display:inline;">
														</div>
													</div>
													<div class="row" style="margin-top:10px;">
														<div class="col-lg-8">
															<p>c、外部智能推荐的接口输入参数</p>
														</div>
														<div class="col-lg-4">
															<select name="smartsuggesttempletinput">
																<option value="">请选择接口输入参数格式化模板</option>
																<#if innputtemlet??>
																<#list innputtemlet as it>
																<option value="${it.id!''}" <#if aiConfig?? && aiConfig.smartsuggesttempletinput?? && aiConfig.smartsuggesttempletinput == it.id>selected="selected"</#if>>${it.name!''}</option>
																</#list>
																</#if>
															</select>
														</div>
													</div>
													<div class="row" style="margin-top:10px;">
														<div class="col-lg-8">
															<p>d、外部智能推荐的输出参数</p>
														</div>
														<div class="col-lg-4">
															<select name="smartsuggesttempletoutput">
																<option value="">请选择接口输出参数格式化模板</option>
																<#if outputtemlet??>
																<#list outputtemlet as it>
																<option value="${it.id!''}" <#if aiConfig?? && aiConfig.smartsuggesttempletoutput?? && aiConfig.smartsuggesttempletoutput == it.id>selected="selected"</#if>>${it.name!''}</option>
																</#list>
																</#if>
															</select>
														</div>
													</div>
													<div class="row" style="margin-top:10px;">
														<div class="col-lg-8">
															<p>e、最多显示推荐数量</p>
														</div>
														<div class="col-lg-4">
															<select name="suggestnum">
																<#list 3..10 as num>
																<option value="${num}" <#if aiConfig?? && aiConfig.suggestnum?? && aiConfig.suggestnum == num>selected="selected"</#if>>${num}</option>
																</#list>
															</select>
														</div>
													</div>
												</div>
											</div>
											
											<!-- 热点问题推荐 -->
											<div class="ukefu-webim-prop">
												<div class="ukefu-webim-tl" style="clear:both;"><span class="inx"><#if aiConfig?? && aiConfig.enableother == true>8<#else>13</#if></span>、启用热点问题推荐</div>
												<div class="box-item">
													<div class="row">
														<div class="col-lg-8">
															<p>自动推荐所设置的问题
																<!-- <a id="wh_time_ranger" href="/apps/xiaoe/topicshot.html" data-toggle="ajax" data-width="650" data-height="350" title="选择问题">点击“添加问题”</a> -->
															</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="checkbox" id="topicshot" name="topicshot" lay-filter="topicshot" title="启用" <#if aiConfig?? && aiConfig.topicshot == true>checked="checked"</#if>>
														</div>
													</div>
												</div>
												<div class="box-item" id="topicshot_item" style="<#if aiConfig?? && aiConfig.topicshot == false>display:none;</#if>">	
													<div class="row">
														<div class="layui-inline" style="margin: 0px 0px 15px 0px;">
															<div class="layui-input-inline" style="width: 500px;margin-left: 5px;">
																<a id="wh_time_ranger" href="/apps/xiaoe/topicshot.html?aiid=${serviceAi.id!''}" data-toggle="ajax" data-width="650" data-height="350" title="选择问题">点击“添加问题”</a>
																或 
																<a id="wh_time_temp" href="#" onclick="newMetrics();">“输入新热点问题”</a>
															</div>
														</div>
													</div>
													<div id="temp">
													<#if aiConfig.hot??>
														<#list aiConfig.hot as hot>
														<div class="row">
															<div class="layui-inline ukefu-item" style="text-align:right;margin-top: 10px">
																<div class='layui-input-inline' style="width: 500px;margin: 10px 0px 10px 5px;">
																	<input class="layui-input inputHotMsg" autocomplete="off" type="text" name="hotmsg" id="topics" value="${hot.title!''}">
																	<input type="hidden" name="topicid" value="${hot.id!''}">
																</div>
																<div  class="layui-input-inline" >
																	<a href='javascript:void(0)' onClick='removeItem(this);' class='ukefu-quality-del' style="padding:8px;border:1px solid #dedede;width:30px;margin-left:20px;">
																		<i class='layui-icon'>&#x1006;</i>
																	</a>
																</div>
															</div>
														</div>
														</#list>
													</#if>
													</div>
													<div id = "toptemp">
														
													</div>
												</div>
											</div>
											<div class="ukefu-webim-prop">
												<div class="ukefu-webim-tl" style="clear:both;"><span class="inx"><#if aiConfig?? && aiConfig.enablesmartsuggest == true>8<#else>14</#if></span>、启用业务数据功能</div>
												<div class="box-item">
													<div class="row">
														<div class="col-lg-8">
															<p>启用业务数据功能，满足触发条件后保存数据</p>
															<p style="color:#888888;font-size:13px;margin-top:10px;">采集访客数据信息保存到联系人或者自动创建工单</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="checkbox" title="启用" name="bussop" id="bussop" lay-filter="bussop" <#if aiConfig?? && aiConfig.bussop == true>checked="checked"</#if>>
														</div>
													</div>
												</div>
												<div class="box-item" id="bussop_tip" style="<#if !(aiConfig??) || aiConfig.bussop == false>display:none;</#if>">	
													<div class="row"  style="margin-bottom:20px;">
														<div class="col-lg-8">
															<p>a、收集以下全部数据后触发</p>
														</div>
													</div>
													<div class="row"  style="margin-bottom:20px;">
														<div class="col-lg-12">
															<#if bussOpList??>
															<#list bussOpList as op>
															<input type="checkbox" name="busslist" title="${op.name!''}" value="${op.code!''}" lay-skin="primary" <#if aiConfig.busslist?? && aiConfig.busslist?index_of(op.code) gte 0>checked="checked"</#if>>
															</#list>
															</#if>
														</div>
													</div>
													<div class="row">
														<div class="col-lg-8">
															<p>b、触发以下业务操作</p>
														</div>
													</div>
													<div class="row" style="margin-top:10px;">
														<div class="col-lg-12">
															<#if bussExecList??>
															<#list bussExecList as exec>
															<input type="checkbox" name="bussexeclist" title="${exec.name!''}" value="${exec.code!''}" lay-filter="bussexec" lay-skin="primary" <#if aiConfig.bussexeclist?? && aiConfig.bussexeclist?index_of(exec.code) gte 0>checked="checked"</#if>>
															</#list>
															</#if>
														</div>
													</div>
													<div class="row" style="margin-top:20px;">
														<div class="col-lg-8">
															<p>信息采集补全时的默认姓名</p>
														</div>
														<div class="col-lg-4">
															<input type="text" name="bussname" id="bussname" value="<#if aiConfig?? && aiConfig.bussname??>${aiConfig.bussname}</#if>" autocomplete="off" class="layui-input">
														</div>
													</div>
													<div class="row" style="margin-top:20px;">
														<div class="col-lg-8">
															<p>默认技能组</p>
														</div>
														<div class="col-lg-4">
															<select name="bussskill">
																<option value="">请选择默认技能组</option>
																<#if skillList??>
																<#list skillList as skill>
																<option value="${skill.id!''}" <#if aiConfig?? && aiConfig.bussskill?? && aiConfig.bussskill == skill.id>selected="selected"</#if>>${skill.name!''}</option>
																</#list>
																</#if>
															</select>
														</div>
													</div>
													<div class="row" style="margin-top:20px;">
														<div class="col-lg-12" id="busslist">
															<div class="row">
																<div class="col-lg-8">
																	<p>包含以下关键词（多个关键词以逗号隔开）的咨询分配到部门（<a href="javascript:void(0)" onclick="$('#busslist').append($('#mapping').text());form.render('select');">增加分配策略</a>）</p>
																</div>
															</div>
															<#list aiConfig.mapping as mapping>
															<div class="row ukefu-mapping" style="margin-top:20px;">
																<div class="col-lg-6">
																	<input type="text" name="keywords" value="${mapping.keyword!''}" autocomplete="off" class="layui-input">
																</div>
																<div class="col-lg-2" style="text-align:center;">
																	<p>分配到</p>
																</div>
																<div class="col-lg-3">
																	<select name="skill">
																		<option value="">请选择默认技能组</option>
																		<#if skillList??>
																		<#list skillList as skill>
																		<option value="${skill.id!''}" <#if mapping.skill == skill.id>selected="selected"</#if>>${skill.name!''}</option>
																		</#list>
																		</#if>
																	</select>
																</div>
																<div class="col-lg-1" style="text-align:center;padding-top:6px;text-align:right;">
																	<a href='javascript:void(0)' onClick='removeMapping(this);' class='ukefu-quality-del' style="padding:8px;border:1px solid #dedede;width:30px;">
																		<i class='layui-icon'>&#x1006;</i>
																	</a>
																</div>
															</div>
															</#list>
														</div>
													</div>
													<div class="row" style="margin-top:20px;">
														<div class="col-lg-8">
															<p>发送短信的模板</p>
														</div>
														<div class="col-lg-4">
															<select name="bussmsgtpl">
																<option value="">请选择短信模板</option>
																<#if smsTempletList??>
																<#list smsTempletList as smsTemplet>
																<option value="${smsTemplet.id!''}" <#if aiConfig?? && aiConfig.bussmsgtpl?? && aiConfig.bussmsgtpl == smsTemplet.id>selected="selected"</#if>>${smsTemplet.name!''}</option>
																</#list>
																</#if>
															</select>
														</div>
													</div>
													
													<div class="row" style="margin-top:20px;">
														<div class="col-lg-8">
															<p>c、允许所有人查看分配的联系人</p>
															<p style="color:#888888;font-size:13px;margin-top:10px;">是否启用共享联系人功能，设置为共享，则所有人都可以看到联系信息</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="checkbox" title="允许" name="bussdisall" id="bussdisall" <#if aiConfig?? && aiConfig.bussdisall == true>checked="checked"</#if>>
														</div>
													</div>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
							
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-lg-3"></div>
					<div class="col-lg-9">
						<div class="layui-form-item">
						  <div class="layui-input-block">
							<button class="layui-btn" lay-submit="" lay-filter="formDemo">保存</button>
							<button type="reset" class="layui-btn layui-btn-primary">重置</button>
						  </div>
						</div>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>
<script id="mapping" type="text/html">
<div class="row ukefu-mapping" style="margin-top:20px;">
	<div class="col-lg-6">
		<input type="text" name="keywords" value="" autocomplete="off" class="layui-input">
	</div>
	<div class="col-lg-2" style="text-align:center;">
		<p>分配到</p>
	</div>
	<div class="col-lg-3">
		<select name="skill">
			<option value="">请选择默认技能组</option>
			<#if skillList??>
			<#list skillList as skill>
			<option value="${skill.id!''}" <#if aiConfig?? && aiConfig.bussskill?? && aiConfig.bussskill == skill.id>selected="selected"</#if>>${skill.name!''}</option>
			</#list>
			</#if>
		</select>
	</div>
	<div class="col-lg-1" style="text-align:center;padding-top:6px;text-align:right;">
		<a href='javascript:void(0)' onClick='removeMapping(this);' class='ukefu-quality-del' style="padding:8px;border:1px solid #dedede;width:30px;">
			<i class='layui-icon'>&#x1006;</i>
		</a>
	</div>
</div>
</script>
<script id="tpl" type="text/html">
<div class="row ukefu-item" style="margin:10px 0px 0px 0px;">
	<div class="layui-inline">
		<div class="layui-input-inline" style="width: 500px;margin-left: 5px;">
			<input class="layui-input inputHotMsg" autocomplete="off" type="text" name="hotmsg" id="topicsh">
			<input type="hidden" name="topicid">
		</div>
	</div>
	<div class='layui-input-inline' style='padding-top:8px;'>
		<a href='javascript:void(0)' onClick='removeItem(this);' class='ukefu-quality-del' style='padding:8px;border:1px solid #dedede;width:30px;margin-left:20px;'>
			<i class='layui-icon'>&#x1006;</i>
		</a>
	</div>
</div>

</script>
<script language="javascript"> 		
	var form = null ; 
	layui.use('form', function(){
		form = layui.form;
		form.render('select'); //刷新select选择框渲染
		form.on("checkbox(askqs)" , function(data){
			if(data.elem.checked == true){
				$('#askqs_item').show();		
			}else{
				$('#askqs_item').hide();
			}
		});
		form.on('checkbox(bussop)', function(data) {
			if(data.elem.checked == true){
				$("#bussop_tip").show();
			}else{
				$("#bussop_tip").hide();
			}
		});
		form.on("checkbox(enablesuggest)" , function(data){
			if(data.elem.checked == true){
				$('#enablesuggest_item').show();		
			}else{
				$('#enablesuggest_item').hide();
			}
		});
		form.on("checkbox(enableother)" , function(data){
			if(data.elem.checked == true){
				$('#other_ai').show();
				$('.ukefu-ai').hide();
				var inx = 1 ;
				$('.inx').each(function(){
					if($(this).closest(".ukefu-ai").length == 0){
						$(this).text(inx);
						inx++ ;						
					}
				});
			}else{
				$('#other_ai').hide();
				$('.ukefu-ai').show();
				
				var inx = 1 ;
				$('.inx').each(function(){
					$(this).text(inx);
					inx++ ;		
				});
			}
		});
		form.on("checkbox(topicuseful)" , function(data){
			if(data.elem.checked == true){
				$('#topicuseful_tip').show();		
			}else{
				$('#topicuseful_tip').hide();
			}
		});
		form.on("checkbox(enk_filter)" , function(data){
			if(data.elem.checked == true){
				$('#enk').show();		
			}else{
				$('#enk').hide();
			}
		});
		form.on("checkbox(sysmsgtransagent)" , function(data){
			if(data.elem.checked == true){
				$('#sysmsgtransagent_tip').show();		
			}else{
				$('#sysmsgtransagent_tip').hide();
			}
		});
		form.on("checkbox(topicshot)" , function(data){
			if(data.elem.checked == true){
				$('#topicshot_item').show();		
			}else{
				$('#topicshot_item').hide();
			}
		});
		form.on("checkbox(entityop)" , function(data){
			if(data.elem.checked == true){
				$('#entityop_tip').show();		
			}else{
				$('#entityop_tip').hide();
			}
		});
		form.on("select(wh_time_ranger)" , function(data){
			var timerange = data.elem[data.elem.selectedIndex].text;
			var id = "wh_"+ data.elem[data.elem.selectedIndex].text;
			if($("#"+id).length == 0){
				$('#workhours').append("<small id='"+id+"' class='ukefu-timerange layui-btn layui-btn-normal'>"+timerange+" <i class='layui-icon'>&#x1006;</i><input type='hidden' name='hotmsg' value='"+timerange+"'/></small>");
			}
		});
		form.on("checkbox(smartsuggestsuggest)" , function(data){
			if(data.elem.checked == true){
				$('#smartsuggestsuggest_op').show();		
			}else{
				
				$('#smartsuggestsuggest_op').hide();
			}
		});
	});
	$('#wh_time_range').on("click" , function(){
		var timerange = $("#topicsh").val();
		var id = "wh_"+ $("#topicsh").val();
		if($("#"+id).length == 0){
			$('#temp').append("<div class='layui-inline ukefu-item' style='padding: 10px 0px 10px 5px;'><div class='layui-input-inline' style='width: 500px;'><input class='layui-input'  autocomplete='off' type='text' name='hotmsg' id='topics' value = '"+ timerange +"'/></div><div class='layui-input-inline'><a href='javascript:void(0)' onClick='removeItem(this);' class='ukefu-quality-del' style='padding:8px;border:1px solid #dedede;width:30px;margin-left:20px;'><i class='layui-icon'>&#x1006;</i></a></div></div>");
			/* $('#workhours').append("<small id='"+id+"' class='ukefu-timerange layui-btn layui-btn-normal'>"+timerange+" <i class='layui-icon'>&#x1006;</i><input type='hidden' name='hotmsg' value='"+timerange+"'/></small>"); */
		}
		$("#topicsh").val("");
	});
	$(document).on("click" , ".ukefu-timerange", function(){
		var target = $(this);
		var index = top.layer.confirm("请确认是否移除该问题？", {icon: 3, title:'提示'}, function(text, cindex){
			top.layer.close(index);
			$(target).remove() ;
		});
		
	});
	function processHotMsgFunction(data){
		if(data!=null){
			data.each(function(){
				$('#temp').append("<div class='layui-inline ukefu-item' style='padding: 10px 0px 10px 5px;'><div class='layui-input-inline' style='width: 500px;'><input class='layui-input inputHotMsg'  autocomplete='off' type='text' name='hotmsg' id='topics' value = '"+ $(this).val() +"'/><input type='hidden' name='topicid' value = '"+ $(this).data('id') +"'/></div><div class='layui-input-inline'><a href='javascript:void(0)' onClick='removeItem(this);' class='ukefu-quality-del' style='padding:8px;border:1px solid #dedede;width:30px;margin-left:20px;'><i class='layui-icon'>&#x1006;</i></a></div></div>");
				bindSuggest($('.inputHotMsg').last());
			});
		}
	}
	function removeItem(obj){
		$(obj).closest(".ukefu-item").remove();
	}
	function removeMapping(obj){
		$(obj).closest(".ukefu-mapping").remove();
	}
	function newMetrics(){
		$('#toptemp').append($('#tpl').text());
		bindSuggest($('.inputHotMsg').last());
	}
	$('.inputHotMsg').each(function(){
		var self = $(this);
		bindSuggest(self) ;
	});
	function bindSuggest(obj){
		layui.use('autocomplete', function(autocomplete){
			autocomplete.init({
	            elem:obj,
	            textLength:0,//触发长度
	            delay:200,//触发延迟
	            callback:{
	                data:function(val,render){
	                	if(val!=null && val.trim() != ''){
		                    loadURL('/rest/webim/hot?aiid=<#if aiConfig??>${aiConfig.aiid!''}</#if>&q='+val,null , function(data){
		                    	render(data.data);
		                    })
	                	}
	                },
	                selected:function(data , target){
	                    //alert(JSON.stringify(data));
	                    $(target).next().val(data.id);
	                },
	                close:function(){

	                }
	            }
	        });
		});
	}
</script>